package com.xzc.refactory.method.introduceExplainingVariable.expWithIntroduce;

public class C1 {
    int _quantity;
    double _itemPrice;

    double price() {
        //price is base price - quantity discount + shipping
        return _quantity * _itemPrice -
                Math.max(0, _quantity - 500) * _itemPrice * 0.05 +
                Math.min(_quantity * _itemPrice * 0.1, 100.0);
    }
}
